#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;

class Solution {
public:
    bool repeatedSubstringPattern(string s)
    {
        int n = s.size();
        for (int i = 1; i * 2 <= n; i++)
        {
            if (n % i == 0)
            {
                int mid = 1;
                for (int j = i; j < n; j++)
                {
                    if (s[j] != s[j - i])
                    {
                        mid = 0;
                        break;
                    }
                }
                if (mid)
                    return true;
            }
        }
        return false;
    }
};